<?php
namespace app\index\model;

use think\Model;

class sc extends Model
{
    public function joincourse($C_Id,$S_Id){
        $Data = [
            "C_Id" => $C_Id,
            "S_Id" => $S_Id,
        ];
        return $this->insert($Data);
    }

    public function del($C_Id){
        return $this->where("C_Id",$C_Id)->update(["isdelete"=>1]);
    }

    public function re($C_Id){
        return $this->where("C_Id",$C_Id)->update(["isdelete"=>0]);
    }

    public function cleartop($S_Id){
        return $this->where("S_Id",$S_Id)->update(["istop"=>0]);
    }

    public function settop($S_Id,$C_Id){
        return $this->where("S_Id",$S_Id)->where("C_Id",$C_Id)->update(["istop"=>1]);
    }
}
?>